import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建床铺
export function createAccommodationBed(data) {
  return request({
    url: adminUrl + '/collegebase/accommodation-bed/create',
    method: 'post',
    data: data
  })
}

// 更新床铺
export function updateAccommodationBed(data) {
  return request({
    url: adminUrl + '/collegebase/accommodation-bed/update',
    method: 'put',
    data: data
  })
}

// 删除床铺
export function deleteAccommodationBed(id) {
  return request({
    url: adminUrl + '/collegebase/accommodation-bed/delete?id=' + id,
    method: 'delete'
  })
}

// 获得床铺
export function getAccommodationBed(id) {
  return request({
    url: adminUrl + '/collegebase/accommodation-bed/get?id=' + id,
    method: 'get'
  })
}

// 获得床铺分页
export function getAccommodationBedPage(query) {
  return request({
    url: adminUrl + '/collegebase/accommodation-bed/page',
    method: 'get',
    params: query
  })
}

// 导出床铺 Excel
export function exportAccommodationBedExcel(query) {
  return request({
    url: adminUrl + '/collegebase/accommodation-bed/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
